package com.tangxz.sso.client.config;

import com.tangxz.sso.core.interceptors.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/07/09 14:51
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**/**")//拦截
//                .excludePathPatterns("/**/login")//放行
                .excludePathPatterns("/**/doLogin")//放行
                .excludePathPatterns("/**/static/**");//放行
    }
}
